package org.com.FeignClient;

import Entity.Community;
import org.com.FeignFallback.CommunityFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "Service-Community", path = "/community", fallback = CommunityFeignFallback.class)
public interface CommunityFeign {
    @GetMapping("/list")
    List<Community> allblog();

    @PostMapping("/save")
    ResponseEntity<Community> save(@RequestBody Community community);

    @PostMapping("/delete/{id}")
    boolean delete(@PathVariable Integer id);
}
